﻿namespace WebServiceExtensions.Configurations.LogExtension
{
    using System.Configuration;

    /// <summary>
    /// Represents trace source
    /// </summary>
    public class TraceSource : ConfigurationElement
    {
		#region Fields (1) 

        /// <summary>
        ///   The name property.
        /// </summary>
        private const string NameProperty = "name";

		#endregion Fields 

		#region Constructors (2) 

        /// <summary>
        /// Initializes a new instance of the <see cref="TraceSource"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        public TraceSource(string name)
		{
			this.Name = name;
		}

        /// <summary>
        /// Initializes a new instance of the <see cref="TraceSource"/> class. 
        /// </summary>
        public TraceSource()
        {
        }

		#endregion Constructors 

		#region Properties (1) 

        /// <summary>
        ///   Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        [ConfigurationProperty(NameProperty, IsRequired = true)]
        public string Name
        {
            get
            {
                return (string)base[NameProperty];
            }

            set
            {
                base[NameProperty] = value;
            }
        }

		#endregion Properties 
    }
}
